package com.test.vue.service.impl;

import com.github.pagehelper.PageInfo;
import com.test.vue.entity.BusStudent;
import com.test.vue.mapper.StudentMapper;
import com.test.vue.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public PageInfo search(BusStudent busStudent) {
        List<BusStudent> busStudents = studentMapper.selectBusStudentList(busStudent);
        PageInfo<BusStudent> pageInfo = new PageInfo<>(busStudents);
        return pageInfo;
    }

    @Override
    public int create(BusStudent busStudent) {
        int result = studentMapper.insertBusStudent(busStudent);
        return result;
    }
}
